<template>
	<view>
		<view style="line-height:100rpx;font-size:40rpx;background:#fff;padding:0 30rpx;box-sizing: border-box;font-weight: bold;">
			实名认证
		</view>
		<form>
			<view class='addAddress'>
				<view class='list'>
					<view class='item acea-row row-between-wrapper' style="border-top:none;">
						<view class='name'>姓名</view>
						<input type='text' placeholder='请输入姓名' v-model="bankInfo.name"
							placeholder-class='placeholder'></input>
					</view>
					<view class='item acea-row row-between-wrapper'>
						<view class='name'>身份证号</view>
						<input type='text' placeholder='请输身份证号' v-model="bankInfo.identityNo"
							placeholder-class='placeholder'></input>
					</view>
				</view>
				<button class='keepBnt bg-color' @click="saveFunc">确定</button>
			</view>
		</form>
	</view>
</template>

<script>
	import {
		setInvoTlSetRealName
	} from '@/api/directSelling.js'
	import {
		shop_ht,
	} from '@/config/app_member.js';
	export default {
		data() {
			return {
				bankInfo: {
					//token: md5('invoTlSetRealName' + getStorage('userInfo').memberCode).toUpperCase(),
					token: "",
					memberCode: "",
					memberType: 3,
					name: null,
					identityNo: null
				},
				bankNameList: [],
				isFirstDxCode: true,
				dxCodeTime: 60,
				dxCodeTimeFun: null
			};
		},
		mounted() {
			this.bankInfo.name = uni.getStorageSync('userInfo').realName || "";
			this.bankInfo.identityNo = uni.getStorageSync('userInfo').idCard || "";
			this.bankInfo.memberCode = uni.getStorageSync('userInfo').memberCode || "";
			this.bankInfo.token=this.$w_md5.hex_md5_32Upper('invoTlSetRealName'+uni.getStorageSync('userInfo').memberCode);
			console.log(this.bankInfo);
		},
		methods: {
			saveFunc() {
				if (!this.bankInfo.name) {
					this.$util.Tips({
						title: '姓名不能为空！'
					});
					return;
				}
				if (!this.bankInfo.identityNo) {
					this.$util.Tips({
						title: '身份证号不能为空！'
					});
					return;
				}
				console.log("提示信息测试是否进入方法");
				
				uni.request({
					url: shop_ht+'/shop_ht/vt/invoTlSetRealName.do',
					method: "get",
					data: this.bankInfo,
					success: (res) => {
						if(res.data.status==1){
							this.$util.Tips({
								title: '认证成功！'
							});
							setTimeout(()=>{
								uni.navigateBack();
								// uni.navigateTo({
								// 	url: "/pages/electronicWallet/bankCardDo/bindMobilePhoneNumber"
								// });
							},2000)
						}else{
							this.$util.Tips({
								title: `${res.data.msg}`
							});
						}
					}
				})	
			}
		}
	}
</script>

<style scoped lang="scss">
	.addAddress .list {
		background-color: #fff;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.addAddress .list .item {
		padding: 30rpx;
		border-top: 1rpx solid #eee;
	}

	.addAddress .list .item .name {
		width: 195rpx;
		font-size: 30rpx;
		color: #333;
	}

	.addAddress .list .item .address {
		// width: 412rpx;
		flex: 1;
		margin-left: 20rpx;
	}

	.addAddress .list .item input {
		width: 400rpx;
		font-size: 30rpx;
		text-align: left;
	}

	.addAddress .list .item .placeholder {
		color: #ccc;
	}

	.addAddress .list .item picker {
		width: 410rpx;
		height: 42rpx;
	}

	.addAddress .list .item picker .picker {
		width: 350rpx;
		font-size: 30rpx;
		text-align: right;
	}

	.addAddress .list .item picker .iconfont {
		font-size: 43rpx;
	}

	.addAddress .default {
		padding: 0 30rpx;
		height: 90rpx;
		background-color: #fff;
		margin-top: 23rpx;
	}

	.addAddress .default checkbox {
		margin-right: 15rpx;
	}

	.addAddress .keepBnt {
		width: 690rpx;
		height: 86rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		margin: 50rpx auto;
		font-size: 32rpx;
		color: #fff;
	}

	.addAddress .wechatAddress {
		width: 690rpx;
		height: 86rpx;
		border-radius: 50rpx;
		text-align: center;
		line-height: 86rpx;
		margin: 0 auto;
		font-size: 32rpx;
		color: #fe960f;
		border: 1px solid #fe960f;
	}

	.dxCodeBox {
		position: absolute;
		right: 10rpx;
		top: 30rpx;
		color: #f00;
		font-size: 28rpx;
	}

	.messageBox {
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		margin-top: 20rpx;
	}
</style>
